import Vue from 'vue'

import 'normalize.css/normalize.css'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss'

import App from './App'
import store from './store'
import router from './router'
import mixin from './mixin'
import i18n from './lang'
import components from './components'
import * as directives from './directives'
import * as filters from './filters'

import '@/icons'
import '@/permission'

Vue.use(components)

Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})

Vue.mixin(mixin)

Object.keys(directives).forEach(item => {
  Vue.directive(item, directives[item])
})

Object.keys(filters).forEach(item => {
  Vue.filter(item, filters[item])
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})
